/*    */ package com.ui;
/*    */ 
/*    */ import com.engine.ReadConfig;
/*    */ import com.engine.SaveConfig;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.io.FileNotFoundException;
/*    */ import java.io.IOException;
/*    */ import javax.swing.AbstractAction;
/*    */ import javax.swing.Action;
/*    */ import javax.swing.JDialog;
/*    */ import javax.swing.JTextField;
/*    */ import org.swixml.SwingEngine;
/*    */ 
/*    */ public class TicketConfig
/*    */ {
/*    */   JDialog dialog;
/*    */   private JTextField host;
/*    */   private JTextField port;
/* 30 */   public Action doCancel = new AbstractAction()
/*    */   {
/*    */     private static final long serialVersionUID = 1L;
/*    */ 
/*    */     public void actionPerformed(ActionEvent e)
/*    */     {
/*    */       try
/*    */       {
/* 39 */         TicketConfig.this.dialog.setVisible(false);
/* 40 */         TicketConfig.this.dialog.dispose();
/*    */       }
/*    */       catch (Exception localException)
/*    */       {
/*    */       }
/*    */     }
/* 30 */   };
/*    */ 
/* 48 */   public Action doApply = new AbstractAction()
/*    */   {
/*    */     private static final long serialVersionUID = 1L;
/*    */ 
/*    */     public void actionPerformed(ActionEvent e)
/*    */     {
/*    */       try
/*    */       {
/* 57 */         SaveConfig.getInstance(null);
/* 58 */         SaveConfig.PUT("TICKET_IP_CONFIG", TicketConfig.this.host.getText());
/* 59 */         SaveConfig.PUT("TICKET_PORT", TicketConfig.this.port.getText());
/* 60 */         SaveConfig.Close();
/* 61 */         TicketConfig.this.dialog.setVisible(false);
/* 62 */         TicketConfig.this.dialog.dispose();
/*    */       }
/*    */       catch (Exception localException)
/*    */       {
/*    */       }
/*    */     }
/* 48 */   };
/*    */ 
/*    */   public TicketConfig()
/*    */     throws Exception
/*    */   {
/* 23 */     SwingEngine swix = new SwingEngine(this);
/* 24 */     swix.render("xml/ticketconfiguration.xml");
/* 25 */     read();
/* 26 */     this.dialog.setVisible(true);
/* 27 */     this.dialog.setModal(true);
/*    */   }
/*    */ 
/*    */   private void read()
/*    */   {
/*    */     try
/*    */     {
/* 73 */       ReadConfig.removeInstance();
/* 74 */       ReadConfig.getInstance(null);
/*    */     }
/*    */     catch (FileNotFoundException e) {
/* 77 */       e.printStackTrace();
/*    */     }
/*    */     catch (IOException e) {
/* 80 */       e.printStackTrace();
/*    */     }
/* 82 */     this.host.setText(ReadConfig.GET("TICKET_IP_CONFIG"));
/* 83 */     this.port.setText(ReadConfig.GET("TICKET_PORT"));
/*    */   }
/*    */ }

/* Location:           F:\16 2\SQ.jar
 * Qualified Name:     com.ui.TicketConfig
 * JD-Core Version:    0.6.0
 */